package com.ruoyi.web.rmNew.service.http;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.thread.ThreadUtil;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.inter.HttpHostProvider;
import com.ruoyi.common.utils.http.HttpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FbHttpService2 {
    private static HttpHostProvider httpHostProvider;

    @Autowired
    public void setHttpHostProvider(HttpHostProvider provider) {
        httpHostProvider = provider;
    }

    public void sendFbDetail(String gameid, String path) {
        JSONObject body = new JSONObject();
        body.put("languageType", "CMN");
        body.put("oddsType", 1);
        body.put("matchId", gameid);
        String url = "https://yapi.weilaiyy2.com/v1/match/getMatchDetail";
        JSONObject result = HttpUtils.httpJsonOfZyt(url, "post", body, null);

        FileUtil.writeString(result.toJSONString(), path, "utf8");
        ThreadUtil.sleep(50);
    }
}
